This document contains instructions on Project 2 for STA 141A in Winter 2021. This document is made with R markdown. The rmd file to generate this document is available on the course website.
We will do an EDA for the WHO COVID-19 data. You can take a look at the weekly WHO COVID-19 update for reference.
library(tidyverse)
library(readxl)
library(data.table)
library(cowplot)
covidmobility <- read_csv("~/Downloads/Global_Mobility_Report.csv") %>% filter(is.na(sub_region_1)) %>% mutate(Date_reported = as.Date(date), Country_code = country_region_code) %>% select(-c("sub_region_1",
"sub_region_2",
"metro_area",
"iso_3166_2_code",
"census_fips_code"))
Parsed with column specification:
cols(
country_region_code = col_character(),
country_region = col_character(),
sub_region_1 = col_character(),
sub_region_2 = col_logical(),
metro_area = col_logical(),
iso_3166_2_code = col_character(),
census_fips_code = col_logical(),
place_id = col_character(),
date = col_date(format = ""),
retail_and_recreation_percent_change_from_baseline = col_double(),
grocery_and_pharmacy_percent_change_from_baseline = col_double(),
parks_percent_change_from_baseline = col_double(),
transit_stations_percent_change_from_baseline = col_double(),
workplaces_percent_change_from_baseline = col_double(),
residential_percent_change_from_baseline = col_double()
)
4617003 parsing failures.
row col expected actual file
3324 metro_area 1/0/T/F/TRUE/FALSE Kabul Metropolitan Area '~/Downloads/Global_Mobility_Report.csv'
3325 metro_area 1/0/T/F/TRUE/FALSE Kabul Metropolitan Area '~/Downloads/Global_Mobility_Report.csv'
3326 metro_area 1/0/T/F/TRUE/FALSE Kabul Metropolitan Area '~/Downloads/Global_Mobility_Report.csv'
3327 metro_area 1/0/T/F/TRUE/FALSE Kabul Metropolitan Area '~/Downloads/Global_Mobility_Report.csv'
3328 metro_area 1/0/T/F/TRUE/FALSE Kabul Metropolitan Area '~/Downloads/Global_Mobility_Report.csv'
.... .......... .................. ....................... ........................................
See problems(...) for more details.
covidWHO <- read_csv("https://covid19.who.int/WHO-COVID-19-global-data.csv") %>% mutate(Date_reported = as.Date(Date_reported))
Parsed with column specification:
cols(
Date_reported = col_date(format = ""),
Country_code = col_character(),
Country = col_character(),
WHO_region = col_character(),
New_cases = col_double(),
Cumulative_cases = col_double(),
New_deaths = col_double(),
Cumulative_deaths = col_double()
)
world_pop = read_csv("~/Downloads/csvData.csv") %>% mutate(Country = name)
Parsed with column specification:
cols(
Rank = col_double(),
name = col_character(),
pop2021 = col_double(),
pop2020 = col_double(),
GrowthRate = col_double(),
area = col_double(),
Density = col_double()
)
covidmobility